package com.ibm.db2oncampus.portal.domain.domain;

import com.ibm.db2oncampus.portal.framework.domain.DomainObject;

/**
 * 
 * @author Wellington
 *
 */
public class Domain implements DomainObject {

	private DomainId id;
	
	private String description;
	
	/**
	 * Construtor default da classe.
	 */
	public Domain() {}

	public DomainId getId() {
		return id;
	}

	public void setId(DomainId id) {
		this.id = id;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Override
	public boolean equals(Object obj) {
		if (! (obj instanceof Domain)) {
			return false;
		}
		
		Domain objDomain = (Domain) obj;
		
		if (objDomain.getId() == null) {
			return false;
		}
		
		if (this.getId() == null) {
			return false;
		}
		
		if (this.getId().getType().equals(objDomain.getId().getType()) &&  this.getId().getValue().equals(objDomain.getId().getValue())) {
			return true;
		}
		
		return false;
	}

	@Override
	public int hashCode() {
		// TODO Auto-generated method stub
		return super.hashCode();
	}
	
	
}